function request(type, data, path) {
    return new Promise(resolve => {
        ajax({
            type,
            data,
            path,
            successCB: res => {
                resolve(res)
            }
        })
    })
}

//注册
<<<<<<< HEAD
const reg = data => request('post', data, '../php/reg.php');

//登录
const login = data => request('get', data, '../php/06login.php')

//列表
const olist = data => request('get', data, '../php/list.php')

//详情页
const detail = data => request('post', data, '../php/detail.php')

//加入购物车
const addToCart = data => request('post', data,'../php/addToCart.php')

//购物车
const cart = data => request('post', data, '../php/cart.php')

//删除
const odelete = data => request('post' , data , '../php/delete.php')
=======
const reg = data => request('post', data, 'http://localhost/ALl/two/czmTest/php/reg.php');

//登录
const login = data => request('get', data, 'http://localhost/ALl/two/czmTest/php/06login.php')

//列表
const olist = data => request('get', data, 'http://localhost/ALl/two/czmTest/php/list.php')

//详情页
const detail = data => request('post', data, 'http://localhost/ALl/two/czmTest/php/detail.php')

//加入购物车
const addToCart = data => request('post', data,'http://192.168.59.240/ALl/two/czmTest/php/addToCart.php')

//购物车
const cart = data => request('post', data, 'http://localhost/ALl/two/czmTest/php/cart.php')

//删除
const odelete = data => request('post' , data , 'http://192.168.59.240/ALl/two/czmTest/php/delete.php')
>>>>>>> c2a0b16d374b2dadbf60483b2ca7e378d937a164

